home *** CD-ROM | disk | FTP | other *** search
/ Pascal Super Library / Pascal Super Library (CW International)(1997).bin / VIEWERS / PWBROWSE / BROWSE.FRM < prev    next >
Text File  |  1993-11-08  |  8KB  |  250 lines

  1. VERSION 2.00
  2. Begin Form frmBrowse 
  3.    BackColor       =   &H00C0C0C0&
  4.    BorderStyle     =   1  'Fixed Single
  5.    Caption         =   "WINDOWS Magazine Version Browser"
  6.    ClientHeight    =   3495
  7.    ClientLeft      =   2040
  8.    ClientTop       =   3300
  9.    ClientWidth     =   6900
  10.    Height          =   4245
  11.    Icon            =   BROWSE.FRX:0000
  12.    Left            =   1950
  13.    LinkTopic       =   "Form1"
  14.    MaxButton       =   0   'False
  15.    ScaleHeight     =   3495
  16.    ScaleWidth      =   6900
  17.    Top             =   2640
  18.    Width           =   7080
  19.    Begin TextBox tbName 
  20.       Height          =   285
  21.       Left            =   240
  22.       TabIndex        =   1
  23.       Text            =   "tbName"
  24.       Top             =   480
  25.       Width           =   3135
  26.    End
  27.    Begin ComboBox cbTypes 
  28.       Height          =   300
  29.       Left            =   240
  30.       Style           =   2  'Dropdown List
  31.       TabIndex        =   7
  32.       Top             =   3000
  33.       Width           =   3135
  34.    End
  35.    Begin FileListBox filBrowse 
  36.       Height          =   1590
  37.       Left            =   240
  38.       MultiSelect     =   2  'Extended
  39.       TabIndex        =   2
  40.       Top             =   960
  41.       Width           =   3135
  42.    End
  43.    Begin DirListBox dirBrowse 
  44.       Height          =   1830
  45.       Left            =   3600
  46.       TabIndex        =   5
  47.       Top             =   720
  48.       Width           =   3135
  49.    End
  50.    Begin DriveListBox drvBrowse 
  51.       Height          =   315
  52.       Left            =   3600
  53.       TabIndex        =   8
  54.       Top             =   3000
  55.       Width           =   3135
  56.    End
  57.    Begin Label Label12 
  58.       BackStyle       =   0  'Transparent
  59.       Caption         =   "Dri&ves:"
  60.       Height          =   255
  61.       Left            =   3600
  62.       TabIndex        =   6
  63.       Top             =   2760
  64.       Width           =   1095
  65.    End
  66.    Begin Label Label3 
  67.       BackStyle       =   0  'Transparent
  68.       Caption         =   "List Files of &Type:"
  69.       Height          =   255
  70.       Left            =   240
  71.       TabIndex        =   3
  72.       Top             =   2760
  73.       Width           =   1815
  74.    End
  75.    Begin Label lblCurDir 
  76.       BackStyle       =   0  'Transparent
  77.       Caption         =   "lblCurDir"
  78.       Height          =   255
  79.       Left            =   3600
  80.       TabIndex        =   9
  81.       Top             =   480
  82.       Width           =   3135
  83.    End
  84.    Begin Label Label2 
  85.       BackStyle       =   0  'Transparent
  86.       Caption         =   "&Directories:"
  87.       Height          =   255
  88.       Left            =   3600
  89.       TabIndex        =   4
  90.       Top             =   240
  91.       Width           =   1335
  92.    End
  93.    Begin Label Label1 
  94.       BackStyle       =   0  'Transparent
  95.       Caption         =   "File &Name:"
  96.       Height          =   255
  97.       Left            =   240
  98.       TabIndex        =   0
  99.       Top             =   240
  100.       Width           =   975
  101.    End
  102.    Begin Menu mnuFile 
  103.       Caption         =   "&File"
  104.       Begin Menu mnuFilePrint 
  105.          Caption         =   "&Print ..."
  106.          Shortcut        =   ^P
  107.       End
  108.       Begin Menu mnuFileSep 
  109.          Caption         =   "-"
  110.       End
  111.       Begin Menu mnuFileExit 
  112.          Caption         =   "E&xit"
  113.       End
  114.    End
  115.    Begin Menu mnuHelp 
  116.       Caption         =   "&Help"
  117.       Begin Menu mnuHelpAbout 
  118.          Caption         =   "&About ..."
  119.          WindowList      =   -1  'True
  120.       End
  121.    End
  122. End
  123.  
  124. Sub cbTypes_Click ()
  125.     Dim Pat As String
  126.     Dim l, r As Integer
  127.  
  128.     Pat = cbTypes.List(cbTypes.ListIndex)
  129.     l = InStr(Pat, "(") + 1
  130.     r = InStr(l, Pat, ")")
  131.     filBrowse.Pattern = Mid$(Pat, l, r - l)
  132.     tbName.Text = filBrowse.Pattern
  133. End Sub
  134.  
  135. Sub dirBrowse_Change ()
  136.     lblCurDir.Caption = dirBrowse.List(dirBrowse.ListIndex)
  137.     filBrowse.Path = dirBrowse.Path
  138. End Sub
  139.  
  140. Sub drvBrowse_Change ()
  141.     dirBrowse.Path = drvBrowse.Drive
  142. End Sub
  143.  
  144. Sub filBrowse_DblClick ()
  145.     Dim FullName As String
  146.     Dim Result As Integer
  147.     Dim VI As VerInfo
  148.  
  149.     FullName = filBrowse.Path + "\" + filBrowse.List(filBrowse.ListIndex)
  150.     frmDisp!lblName.Caption = FullName
  151.     frmDisp!lblSize.Caption = Format$(FileLen(FullName), "###,###,###,##0 \b\y\t\e\s")
  152.     frmDisp!lblDate.Caption = Format$(FileDateTime(FullName), "dddd, mmmm d, yyyy \a\t h:mm AM/PM")
  153.     
  154.     Result = GetFileVersion(FullName, VI)
  155.     frmDisp!lblFileVersion.Caption = VI.FileVersion
  156.     frmDisp!lblFileDescription.Caption = VI.FileDescription
  157.     frmDisp!lblCompanyName.Caption = VI.CompanyName
  158.     frmDisp!lblLanguage.Caption = VI.Language
  159.     frmDisp!lblComments.Caption = VI.Comments
  160.     frmDisp!lblOriginalFileName.Caption = VI.OriginalFileName
  161.     frmDisp!lblInternalName.Caption = VI.InternalName
  162.     frmDisp!lblCopyright.Caption = VI.LegalCopyright
  163.     frmDisp!lblTrademarks.Caption = VI.LegalTrademarks
  164.     frmDisp!lblProductName.Caption = VI.ProductName
  165.     frmDisp!lblProductVersion.Caption = VI.ProductVersion
  166.     frmDisp!lblPrivateBuild.Caption = VI.PrivateBuild
  167.     frmDisp!lblSpecialBuild.Caption = VI.SpecialBuild
  168.     frmDisp.Show 0
  169. End Sub
  170.  
  171. Sub Form_Load ()
  172.     Dim Default As Integer
  173.     Dim Result As Integer
  174.     
  175.     ' Load choices into File Type Dropdown list box
  176.     cbTypes.AddItem "All Executables (*.EXE;*.DLL;*.DRV;*.VBX;*.CPL;*.286;*.386;*.2GR;*.3GR;*.FOT;*.FON)"
  177.     cbTypes.AddItem "EXEs (*.EXE)"
  178.     cbTypes.AddItem "DLLs (*.DLL)"
  179.     cbTypes.AddItem "Drivers (*.DRV)"
  180.     cbTypes.AddItem "VB eXtensions (*.VBX)"
  181.     cbTypes.AddItem "Control Panel Applet (*.CPL)"
  182.     cbTypes.AddItem "Standard Mode Driver (*.286)"
  183.     cbTypes.AddItem "Enhanced Mode Driver (*.386)"
  184.     cbTypes.AddItem "Standard Mode Grabber (*.2GR)"
  185.     cbTypes.AddItem "Enhanced Mode Grabber (*.3GR)"
  186.     cbTypes.AddItem "TrueType Fonts (*.FOT)"
  187.     cbTypes.AddItem "Other Fonts (*.FON)"
  188.     cbTypes.ListIndex = 0 ' set default to All Executables
  189.  
  190.     lblCurDir.Caption = dirBrowse.List(dirBrowse.ListIndex)
  191.  
  192.     ' move forms to position they had at end of last run
  193.     Default = (Screen.Height - frmBrowse.Height) / 2
  194.     Result = GetPrivateProfileInt("VerBrowse", "Top", Default, "WINMAG.INI")
  195.     frmBrowse.Top = Result
  196.     Default = (Screen.Width - frmBrowse.Width) / 2
  197.     Result = GetPrivateProfileInt("VerBrowse", "Left", Default, "WINMAG.INI")
  198.     frmBrowse.Left = Result
  199.     
  200.     Default = (Screen.Height - frmDisp.Height) / 2
  201.     Result = GetPrivateProfileInt("VerDisp", "Top", Default, "WINMAG.INI")
  202.     DispTop = Result
  203.     frmDisp.Top = DispTop
  204.     Default = (Screen.Width - frmDisp.Width) / 2
  205.     Result = GetPrivateProfileInt("VerDisp", "Left", Default, "WINMAG.INI")
  206.     DispLeft = Result
  207.     frmDisp.Left = DispLeft
  208.     
  209.     Default = (Screen.Height - frmPrint.Height) / 2
  210.     Result = GetPrivateProfileInt("VerPrint", "Top", Default, "WINMAG.INI")
  211.     PrintTop = Result
  212.     frmPrint.Top = PrintTop
  213.     Default = (Screen.Width - frmPrint.Width) / 2
  214.     Result = GetPrivateProfileInt("VerPrint", "Left", Default, "WINMAG.INI")
  215.     PrintLeft = Result
  216.     frmPrint.Left = PrintLeft
  217. End Sub
  218.  
  219. Sub Form_Unload (Cancel As Integer)
  220.     Unload frmDisp
  221.     Unload frmPrint
  222.  
  223.     ' save the form position for next time
  224.     Result = WritePrivateProfileString("VerBrowse", "Top", Format$(frmBrowse.Top), "WINMAG.INI")
  225.     Result = WritePrivateProfileString("VerBrowse", "Left", Format$(frmBrowse.Left), "WINMAG.INI")
  226.     Result = WritePrivateProfileString("VerDisp", "Top", Format$(DispTop), "WINMAG.INI")
  227.     Result = WritePrivateProfileString("VerDisp", "Left", Format$(DispLeft), "WINMAG.INI")
  228.     Result = WritePrivateProfileString("VerPrint", "Top", Format$(PrintTop), "WINMAG.INI")
  229.     Result = WritePrivateProfileString("VerPrint", "Left", Format$(PrintLeft), "WINMAG.INI")
  230.     End
  231. End Sub
  232.  
  233. Sub MnuFileExit_Click ()
  234.     Unload frmBrowse
  235. End Sub
  236.  
  237. Sub MnuFilePrint_Click ()
  238.     frmPrint.Show 1 ' modal
  239. End Sub
  240.  
  241. Sub mnuHelpAbout_Click ()
  242.     frmAbout.Show 1 ' show About box, wait till it exits
  243. End Sub
  244.  
  245. Sub tbName_Change ()
  246.     On Error Resume Next ' so we can stuff incomplete info into .Pattern
  247.     filBrowse.Pattern = tbName.Text
  248. End Sub
  249.  
  250.